/* 
* @Author: anchen
* @Date:   2018-12-31 10:08:15
* @Last Modified by:   anchen
* @Last Modified time: 2018-12-31 15:53:50
*/
$(function () {

});

function searchData() {


    var table = layui.table, layer = layui.layer;

    table.init('serviceTable',{
        data: [
            {
                id:1,
                "JJHMC":"广东基金会",
               "DJZH":"350322********0072",
               "YWZGDW":"**主管单位",
               "FDDBR":"张飞下",
               "CLSJ":"2018-01-23",
               "ZXSJ":"2018-09-12"
            }

        ]
        , toolbar: true
        , title: '基金会注销登记信息'
        , page: true
    });

    //监听行工具事件
    table.on('tool(serviceTable)', function (obj) { //注：tool 是工具条事件名，test 是 table 原始容器的属性 lay-filter="对应的值"
        var data = obj.data //获得当前行数据
            , layEvent = obj.event; //获得 lay-event 对应的值

        if (layEvent === 'detail') {
            loadDetail(data.id)
        }
    });
}

function loadDetail(id) {
    var data = [
           {
               "JJHMC":"广东基金会",
               "DJZH":"350322********0072",
               "YWZGDW":"**主管单位",
               "FDDBR":"张飞下",
               "CLSJ":"2018-01-23",
               "ZXSJ":"2018-09-12",
               "ZXYY":"缺少资金",
               "JBR":"傅新航"
           }

    ];


    var data0 = data[parseInt(id) - 1];

    $('#detailD').html(template('detailDS',{data:data0}))
    layer.open({
        type: 1,
        content: $("#detail"),
        area: ['900px', '550px'],
        title: '基金会注销登记信息',
        maxmin: true,
        shade: 0,
        cancel: function () {
            $("#detail").hide()
        }
    });


}